﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace genQiang
{
    public partial class MainWin : Form
    {
        public static string FYCS = "01";
        public static string ZHCS = "02";
        public static string JYCS = "03";
        public static Form mainWin=null;
        public static string youName = "TestJI";
        public static string banbenhao = "&V1.0";
        public MainWin()
        {
            InitializeComponent();
            mainWin=this;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Visible = false;
            new Form1().Show();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Visible = false;
            new Form2().Show();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            this.Visible = false;
            new Form3().Show();
        }

        private void MainWin_Load(object sender, EventArgs e)
        {
            this.FormBorderStyle = FormBorderStyle.FixedSingle;
            this.MaximizeBox = false;
            nameTextBox.Text = youName;
            this.Text = this.Text + banbenhao;
       
        }


        //反应测试排行榜
        private void button4_Click(object sender, EventArgs e)
        {
            string resp = HttpUtils.HttpGet("getcj/" + FYCS + "/ms");
            MessageBox.Show(resp, "排行榜TOP10");
        }

        private void button5_Click(object sender, EventArgs e)
        {
            string resp = HttpUtils.HttpGet("getcj/" + ZHCS + "/分");
            MessageBox.Show(resp, "排行榜TOP10");
        }

        private void SetNameBtn_Click(object sender, EventArgs e)
        {
            string wb = nameTextBox.Text;
            if (wb.Length>0 && wb.Length <= 6)
            {
                MainWin.youName = wb;
                MessageBox.Show("设置完毕");
            }else
            {
                MessageBox.Show("名字长度1-6个字符!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                nameTextBox.Text = youName;
            }
        }

        private void button6_Click(object sender, EventArgs e)
        {
            this.Visible = false;
            new Form4().Show();
        }

        private void button7_Click(object sender, EventArgs e)
        {
            string resp = HttpUtils.HttpGet("getcj/" + JYCS + "/关");
            MessageBox.Show(resp, "排行榜TOP10");
        }
    }
}
